<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/lecturer.css"/>
    <script type="text/javascript" src="js/jquery.1.9.1.js" ></script>
    <script type="text/javascript" src="js/mobileSelect.js"></script>
	<link rel="stylesheet" type="text/css" href="css/mobileSelect.css"/>
    <script type="text/javascript" src="js/rem.js" ></script>
    <script type="text/javascript" src="js/mescroll.min.js" ></script>
	<link rel="stylesheet" type="text/css" href="css/mescroll.min.css"/>
	<title>派讲师</title>
</head>
<body>
	<div class="top">
		<div class="top_center">
			<span class="top_left_con1">
				<div id="trigger4" class="trigger4" style="display: inline-block;font-size: 0.28rem;color: #555;">
					开会周次
				</div>
			</span>
			<img class="top_left_xia1" src="img/jtxia.png" />
		</div>
	</div>
	<div id="mescroll" class="mescroll">
		<ul class="list">
	        <li>
        			<div class="number">北京分公司
        				<span class="num_right"><img src="img/jia.png"/></span>
        				<p class="taskinfo info">开会场次：5场  开会地点：海淀</p>
        			</div>
	            <div class="date">
	                <span class="date_left">10.19-20号：珠海初一5场、高一2场。</span>
	            </div>
	       </li>
	       <li>
        			<div class="number">北京分公司
        				<span class="num_right"><img src="img/top_bg.jpg"/></span>
        				<p class="taskinfo info">开会场次：5场  开会地点：海淀</p>
        			</div>
	            <div class="date">
	                <span class="date_left">10.19-20号：珠海初一5场、高一2场。</span>
	            </div>
	       </li>
	    </ul>
	</div>
	<a href="#"><div class="submit">新增</div></a>
</body>
<!--<script>
  var mescroll = new MeScroll("mescroll", { //第一个参数"mescroll"对应上面布局结构div的id
    //如果下拉刷新是重置列表数据,那么down完全可以不用配置
    down: {
      callback: downCallback //下拉刷新的回调
    },
    up: {
      auto:false,//在初始化完毕之后自动执行下拉刷新的回调  true  false
      htmlNodata: '<p class="upwarp-nodata">没有更多了..</p>',
      page: {
        num: 0,
        size: 10,
        time: null
      },
      callback: upCallback    //上拉加载的回调
    }
  });

  var pageSize = 10;
  function downCallback(page) {
    $.ajax({
      url: '',
      type: 'get',
      data:{},
      success: function (res) {
        mescroll.resetUpScroll();
      },
      error: function () {
        // 联网失败的回调,隐藏下拉刷新的状态
        mescroll.endErr();
      }

    })
  }

  function upCallback(page) {
    $.ajax({
      url: '',
      type: 'get',
      success: function (res) {
        var list = res.rows.data;
        if(list.length > 0) { //有数据
          $('.list').append(render(list));
        }
        if (res.rows.data && res.rows.data.length == page.size) {
          //联网成功的回调,隐藏下拉刷新的状态（参数：当前页的数据个数, 是否有下一页true/false）;
          mescroll.endSuccess(res.rows.data.length, true);
        } else {
          //联网成功的回调,隐藏下拉刷新的状态（参数：当前页的数据个数, 是否有下一页true/false）;
          mescroll.endSuccess(res.rows.data.length, false);
        }
      },
      error: function () {
        // 联网失败的回调,隐藏下拉刷新的状态
        mescroll.endErr();
      }
    })
  }
  function render(data)
  {
    var html ='';
    $.each(data,function (index,value) {
      console.log(value);
      html +='<li><div class="number">'+value.title
      	+'<span class="num_right"><img src="img/jia.png"/></span><p class="taskinfo info">开会场次：'+value.znum
      	+'场 开会地点：'+value.addr
      	+'</p></div><div class="date"><span class="date_left">'+value.info
      	+'</span></div></li>';
    });
    return html;
  }
</script>-->
<script>
	var yearindex = parseInt(new Date().getFullYear())-2018;
	var mobileSelect4 = new MobileSelect({
	    trigger: '#trigger4',
	    title: '周次选择',
	    wheels: [{data:[
	    					{
                            id:'1',
                            value:'',
                            childs:[
                                {id:'A1',value:''},
                            ]
                        }
	    			]}],
	    	 position:[yearindex,20],
		 transitionEnd:function(indexArr, data){},
		 callback:function(indexArr, data){
		 	var strs = data[1].name.split(",");
		 	$('#trigger4').text(strs[0]);
		    $('#week').val(data[1].value);
		 }
	});
	var arr = [];
  	$.ajax({
	  url: 'https://oa.fc62.com/api/ajax/year?num=5',
	  type: 'get',
	  success: function (year) {
	  		$.each(year.data,function (index,value) {
	  			 arr[index] = value;
	  			$.get('https://oa.fc62.com/api/ajax/year?year='+value.value,function (week) {
						arr[index]['childs'] = week.data;
					});

		   });
//		   console.log(arr);
		   mobileSelect4.updateWheels(arr);
	  }
	});
</script>
</html>
